package org.millioncall.yueyoga.admin.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.Chedule;
import org.millioncall.yueyoga.admin.model.CheduleDetails;
import org.millioncall.yueyoga.admin.model.ClassScheduleModel;

public interface CheduleService {
	public int deleteByPrimaryKey(Integer id);

	public int insert(Chedule record);

	public int insertSelective(Chedule record);

	public Chedule selectByPrimaryKey(Integer id);

	public int updateByPrimaryKeySelective(Chedule record);

	public int updateByPrimaryKey(Chedule record);

	public int updateOrInsert(Chedule record);

	public List<Chedule> findBySubjectId(Integer subjectId);

	public PaginatedList<Chedule> getCheduleInPage(int start, int pageSize,
			Map<String, Object> map);

	public boolean updateClassChedule(Map<String, Object> map);

	public Chedule getCheduleById(Integer cheduleId);

	public boolean deleteScheduleByCdts(String kcxh, String scheduleId,
			String curDate);

	public boolean reservateSeat(String kcxh, String scheduleId, String curDate);

	public boolean addScheduleDetail(CheduleDetails sd);

	/**
	 * 查找全部消费课程
	 * 
	 * @param map
	 *            参数集合
	 * @param start
	 *            第几页第一条
	 * @param limit
	 *            每页显示几条
	 * */
	public PaginatedList<Chedule> findConsumptionSchedule(
			Map<String, Object> map, Integer start, Integer limit);

	/**
	 * 查找新课程
	 * */
	public Chedule findConsumptionNewById(Map<String, Object> map);

	/**
	 * 根据班级，日期获取课程信息
	 */
	public List<ClassScheduleModel> findScheduleInfoList(String clazzId,
			String kcrq, String hallCode, String memberId);

	/**
	 * 根据班级，日期获取当前课程信息
	 */

	public List<ClassScheduleModel> findNowScheduleInfoList(String clazzId,
			String organizationId);

	/**
	 * 根据日期获取个人所预定的课程列表
	 * 
	 * @param date
	 *            日期
	 * @param memberId
	 *            会员编号
	 * @return
	 */
	public List<ClassScheduleModel> findPersonScheduleList(String clazzId,
			String date, String memberId, String hallCode);

	List<ClassScheduleModel> findAttendScheduleList(String clazzId,
			String date, String memberId, String hallCode);

	/**
	 * 查找符合自动几天开启条件的课程1
	 * 
	 * @param map
	 *            参数集合
	 * */
	public List<Chedule> findAllScheduleOneReserve(Map<String, Object> map);

	/**
	 * 更新自动几天开启预定
	 * 
	 * @param map
	 *            参数集合
	 * */
	public int updateScheduleReserve(Map<String, Object> map);

	/**
	 * 查出一天的所有周课程编号
	 * 
	 * @param aDay
	 * @return
	 */
	public Set<String> findAllWeekClassIds(Date aDay);

	/**
	 * 查出一天的所有日期课程编号
	 * 
	 * @param aDay
	 * @return
	 */
	public Set<String> findAllDateClassIds(Date aDay);

}